<?php
/*
 *      main.php
 *      
 *      Copyright 2011 unro <unro.ua@gmail.com>
 *      
 *      This program is free software; you can redistribute it and/or modify
 *      it under the terms of the GNU General Public License as published by
 *      the Free Software Foundation; either version 2 of the License, or
 *      (at your option) any later version.
 *      
 *      This program is distributed in the hope that it will be useful,
 *      but WITHOUT ANY WARRANTY; without even the implied warranty of
 *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *      GNU General Public License for more details.
 *      
 *      You should have received a copy of the GNU General Public License
 *      along with this program; if not, write to the Free Software
 *      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 *      MA 02110-1301, USA.
 */ 
include ("../session.php");

$uid = $_SESSION["uid"];

$select = $HOST->Query("SELECT * FROM `account` WHERE `id`='$uid'","authdb");
$accinfo = mysql_fetch_array($select);

$chrfix = trim(mysql_escape_string($_GET['unbug']));
settype($chrfix, "int");
$chrid = trim(mysql_escape_string($_GET['chr']));
settype($chrid, "int");
?>
<table width="auto" align="center">
	<tr>
		<td>
		<table id="acc_info">
			<tr><td> 
				<tr><td>Аккаунт:</td><td><b><?php print $_SESSION["accname"]; ?></b></td></tr>
				<tr><td>Количество бонусов:</td><td><?php echo $accinfo['bonuses']; ?></td></tr>
			</td></tr>
			<tr><td>
				<tr><td>e-mail:</td><td><?php echo $accinfo['email'];?></td></tr>
				<tr><td>Забанен:</td><td><?php if($cAcc->Chechban($uid)) echo "<font color=\"#FF0000\">Да</font>"; else echo "<font color=\"#00FF03\">Нет</font>";?></td></tr>
				<tr><td>IP-адрес</td><td><?php echo $accinfo['last_ip']; ?></td></tr>				
			</td></tr>
		</table>
		</td>
		<td>
		<table id="charlist">
			<tr><td><?php $cChar->PrintCharlist($uid); ?></td></tr>
		</table>
		</td>
	</tr>
	<?php
	if($chrfix!=1) {
		echo "<tr><td colspan=\"2\">".$cChar->PrintCharsinfo($chrid)."</td></tr>";
	} else {
		echo "<tr><td colspan=\"2\">".$cChar->CharFix($chrid)."</td></tr>"; }
	?>
</table>